package org.smile.playground;

import com.sun.org.apache.bcel.internal.generic.SWAP;

public class StringTest {
    public StringTest() {

    }

    public static void main(String[] args) {
        String s1 = "space";
        String s2 = "space";
        s1 = s1 + "2";

        if (s1 == s2) {  //s1.equals(s2)
            System.out.println("1.true");
        }

        String s3 = new String("space");
        String s4 = new String("space");

        if (s3 == s4) {
            System.out.println("2.true");
        }

        int a = 32;
        int b = a;

        a = 45;
        System.out.println("b: " + b);

        Integer A = 32;
        Integer B = A;

        A = 45;
        System.out.println("B: " + B);


        String str1 = "s";
        String str2 = str1;

        str1 = "r";
        System.out.println(str2);

        String Str3 = new String("q");
        String Str4 = Str3;

        Str3 = new String ("w");
        System.out.println(Str4);


        int[] number = {1,3,5,7};
        int[] number2 = number;

//        int[] number3 = {2,4,6,8};
//        number = number3;

        number[0] = 2;

        for ( int i : number2){
            System.out.print(i);
        }

        int m = 2;
        int n = 3;
        swap(m,n);
    }

    public static void swap(int a, int b){
        int temp = a;
        a = b;
        b = temp;
    }
}
